#include <bits/stdc++.h>
using namespace std;

#define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
#define dbg(x...)                             \
	{                                         \
		cerr << "\033[32;1m" << #x << " -> "; \
		err(x);                               \
	}
void err()
{
	cerr << "\033[39;0m" << endl;
}
template <typename T, typename... A>
void err(T a, A... x)
{
	cerr << a << ' ';
	err(x...);
}
#else
#define dbg(...)
#endif

typedef long long LL;

typedef pair<LL, LL> P;

const int N = 105;

P p[N], a, b;
P st;
LL t;

LL dis(const P &a, const P &b)
{
	LL dx = a.first - b.first, dy = a.second - b.second;
	if (dx < 0)
		dx = -dx;
	if (dy < 0)
		dy = -dy;
	return dx + dy;
}

int main(int argc, char const *argv[])
{
	cin >> p[0].first >> p[0].second >> a.first >> a.second >> b.first >> b.second;
	cin >> st.first >> st.second >> t;
	int m = 1;
	while (1)
	{
		p[m].first = a.first * p[m - 1].first + b.first;
		p[m].second = a.second * p[m - 1].second + b.second;
		if (p[m].first >= 2e16 || p[m].second >= 2e16)
		{
			++m;
			break;
		}
		++m;
	}

	int ans = 0;
	for (int i = 0; i < m; ++i)
	{
		if (dis(st, p[i]) <= t)
		{
			LL tt = t - dis(st, p[i]);
			int tans0 = 1, tans = 1;
			for (int j = i + 1; j < m; ++j)
			{
				LL cost = dis(p[j - 1], p[j]);
				if (cost > tt)
					break;
				tt -= cost;
				++tans0;
			}
			tans = max(tans, tans0);
			tans0 = 1;
			tt = t - dis(st, p[i]);
			for (int j = i - 1; j >= 0; --j)
			{
				LL cost = dis(p[j + 1], p[j]);
				if (cost > tt)
					break;
				tt -= cost;
				tans0++;
			}
			tans = max(tans, tans0);
			ans = max(ans, tans);
		}
	}

	printf("%d\n", ans);

	return 0;
}